<template>
  <div class="login-container" @keyup.enter.native="handleLogin">
    <div class="login-info animated fadeInLeft">
      <h2 class="login-info-title">{{site.info.title}}</h2>
      <ul class="login-info-list">
        <li class="login-info-item" v-for="(item, index) in site.info.list" :key="index">
          <i class="el-icon-check"></i>&nbsp;{{item}}
        </li>
      </ul>
    </div>
    <div class="login-border">
      <div class="login-main">
        <h4 class="login-title">登录{{site.title}}</h4>
        <el-tabs v-model="activeName">
          <el-tab-pane label="用户密码" name="user">
            <user-login/>
          </el-tab-pane>
          <el-tab-pane label="短信验证码" name="code">
            <code-login/>
          </el-tab-pane>
        </el-tabs>
      </div>
    </div>
  </div>
</template>

<script>
  import {mapGetters} from "vuex";
  import UserLogin from "./login/UserLogin";
  import CodeLogin from "./login/CodeLogin";

  export default {
    name: "login",
    components: {
      CodeLogin,
      UserLogin},
    data() {
      return {
        activeName: "user"
      };
    },
    created() {
    },
    mounted() {
    },
    computed: {
      ...mapGetters(["site"])
    },
    props: [],
    methods: {}
  };
</script>

<style lang="stylus" rel="stylesheet/stylus">
  @require "../ui/common/stylus/variable.styl"
  
  .login-container {
    display: flex;
    align-items: center;
    justify-content: space-around;
    background: rgba(0, 0, 0, 0.2);
    position: relative;
    height 100%;
  }
  
  .login-container::before {
    z-index: -999;
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-image: url("../assets/login.png");
    background-size: cover;
  }
  
  .login-info {
    padding-left: 60px;
    color $color-white;
  }
  
  .login-info-title {
    line-height: 90px;
  }
  
  .login-info-item {
    font-size: $fontsize-large
    line-height 1.6;
  }
  
  .login-border {
    display: flex;
    justify-content: center;
    flex-direction: column;
    padding: 30px 50px 25px 50px;
    background-color: $color-white;
    border-radius: 6px;
    box-shadow: 1px 1px 2px $color-light-grey-ss;
  }
  
  .login-main {
    border-radius: 3px;
    box-sizing: border-box;
    background-color: $color-white;
  }
  
  .login-main > h4 {
    margin-bottom: 20px;
  }
  
  .login-title {
    margin: 0 0 20px;
    text-align: center;
    color: $color-info;
    letter-spacing: 3px;
  }
  
  .login-submit {
    margin-top: 20px;
    width: 100%;
    border-radius: 4px;
  }
  
  .login-form {
    margin: 10px 0;
    .el-form-item__content {
      width: 270px;
    }
    .el-form-item {
      margin-bottom: 12px;
    }
    .el-input {
      input {
        text-indent: 5px;
        border-color: $color-light-grey-ss;
        border-radius: 3px;
      }
      .el-input__prefix {
        i {
          padding: 0 5px;
          font-size: $fontsize-large !important;
        }
      }
    }
  }
  
  .login-code {
    display: flex;
    align-items: center;
    justify-content: space-around;
    margin: 0 0 0 10px;
  }
  
  .login-code-img {
    margin-top: 2px;
    width: 100px;
    height: 32px;
    border: 1px solid $color-light-grey-ss;
    color: #333;
    font-size: $fontsize-medium
    font-weight: bold;
    letter-spacing: 5px;
    line-height: 32px;
    text-indent: 5px;
    text-align: center;
  }
</style>
